Post

Replies

Boosts

Views

Activity

iOS App Crash for optimised builds generated by Xcode above 11.3
The app crashes with Thread 1: EXCBADINSTRUCTION (code=EXCI386INVOP, subcode=0x0) when I add the instance of the below mentioned view as subview to any VC's view. Reason : the lblContainer gets deallocated after being assigned by a local var object . The crash doesn't reproduce when I use a let variable to create the view and assign it to lblContainer. class HorizontalViewMore: UIView {     private weak var lblContainer : UIView!     override init(frame: CGRect) {        	 super.init(frame: frame)        	 createViews() 		}        required init?(coder aDecoder: NSCoder) {         fatalError("init(coder:) has not been implemented") 		}        func createViews() { //it crashes only when the object is declared as var not let         var view : UIView = UIView.init(frame: CGRect.zero)         self.lblContainer = view;         self.lblContainer.isUserInteractionEnabled = false	 //it often crashes here with //Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)         self.lblContainer.translatesAutoresizingMaskIntoConstraints = false;         self.addSubview(self.lblContainer)         self.lblContainer.backgroundColor = UIColor.clear;         self.lblContainer.centerXAnchor.constraint(equalTo: self.centerXAnchor).isActive = true;         self.lblContainer.centerYAnchor.constraint(equalTo: self.centerYAnchor).isActive = true;         self.lblContainer.leftAnchor.constraint(greaterThanOrEqualTo: self.leftAnchor, constant: 8.0).isActive = true         self.lblContainer.rightAnchor.constraint(lessThanOrEqualTo: self.rightAnchor, constant: -8.0).isActive = true 		}    deinit {         print("MemTest : HorizontalViewMore is deinitialized")     } } Also the crash happens only in the optimised builds compiled with Xcode version above 11.3. The optimisation settings are : Apple CLang Code Generation Optimization Level: Fastest, Smallest [-Os] Swift Compiler - Code Generation Optimization Level: Optimize for speed [-O] You can find my sample project here - https://github.com/KirtyKumari/VarLetTest Could anyone please explain this behaviour to me ?
6
0
1.3k
Nov ’20
Universal links issue in case of automatic redirection
Team, we have recently enabled universal links for our app. And our customers started facing one issue during the login flow. For login we generally open a web view inside the app with /login url Our login process can be configured with different IDPs, which takes care of authentication and once the authentication is done, IDP gives a callback to our server /callback. Once the callback succeeds, web view closes and we receive a token using deeplink of our app. (app://code) But for some IDPs the callback made to our domain /callback is received by the app and the login process stops in between. It doesn't happen for all the IDPs, so I am not sure what is going wrong. From what I know, in case of universal link redirection calls shouldn't open the app and should have been continued in browser then why we are receiving the automatic redirection calls to the app. Is there any response header in the redirection call that decides whether to open the url in web or app?
0
0
438
Jan ’24